package net.daum.webtoon.android.dto;

import java.util.Iterator;

import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

public class DTO_PictureImage extends JSonDataObjectBase {
	public String TAG = getClass().getSimpleName();

	public String id;
	public String height;
	public String mediaType;
	public String url;
	public String width;
	public String size;
	public String name;

	public String getTAG() {
		return TAG;
	}

	public String getId() {
		return id;
	}

	public String getHeight() {
		return height;
	}

	public String getMediaType() {
		return mediaType;
	}

	public String getUrl() {
		return url;
	}

	public String getWidth() {
		return width;
	}

	public String getSize() {
		return size;
	}

	public String getName() {
		return name;
	}

	public DTO_PictureImage(JSONObject aJsonObject) {
		Iterator<Object> iterator = aJsonObject.keys();

		while (iterator.hasNext()) {
			Object obj = iterator.next();
			if (obj.toString().equalsIgnoreCase("newImage")) {
				try {
					Log.d(TAG, "newImage == " + aJsonObject.getJSONObject("newImage").toString());
				} catch (JSONException e) {
					if (isDebug)
						e.printStackTrace();
				}
			} else if (obj.toString().equalsIgnoreCase("pictureImage")) {
				try {
					Log.d(TAG, "pictureImage == " + aJsonObject.getJSONObject("pictureImage").toString());
				} catch (JSONException e) {
					if (isDebug)
						e.printStackTrace();
				}
			} else if (obj.toString().equalsIgnoreCase("smallPictureImage")) {
				try {
					Log.d(TAG, "smallPictureImage == " + aJsonObject.getJSONObject("smallPictureImage").toString());
				} catch (JSONException e) {
					if (isDebug)
						e.printStackTrace();
				}
			} else {
				setMemberFiled(this, aJsonObject, obj.toString());
			}
		}

		printMembers();
		insertObjToDB();

	}
}
